package cn.iocoder.yudao.framework.location;

import cn.iocoder.yudao.framework.business.basic.enums.EnumCodable;
import jakarta.annotation.Nullable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/05/17
 */
@Getter
@RequiredArgsConstructor
public enum LocationProvider implements EnumCodable {
    Default("default", "GeoJSON"),
    AMap("amap", "高德地图"),
    Tianditu("tianditu", "天地图"),
    Tencent("tencent", "腾讯地图"),
    Baidu("baidu", "百度地图"),
    ;

    private final String code;
    private final String name;

    @Nullable
    public static LocationProvider getByCode(String code) {
        for (LocationProvider provider : values()) {
            if (provider.getCode().equals(code)) {
                return provider;
            }
        }
        return null;
    }

}
